package com.yxym.homework;

public class Homework05 {
    public static void main(String[] args) {
        String s1 = "yy";
        Animal animal = new Animal(s1);
        Animal animal1 = new Animal(s1);
        System.out.println(animal == animal1);//f
        System.out.println(animal.equals(animal1));//f
        System.out.println(animal.name == animal1.name);//t
        String s4 = new String("mmm");
        String s5 = "mmm";
        System.out.println(s4 == s5);//f
        String t1 = "hello" + s1;
        String t2 ="helloyy";
        System.out.println(t1.intern() == t2);//f

    }
}
class Animal{
    String name;
    public Animal(String name){
        this.name = name;
    }
}
